package com.cx.controller;

import com.cx.entity.Employee;
import com.cx.mapper.EmployeeMapper;
import com.cx.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("emp")
public class EmployeeController {
    @Autowired
    private EmployeeMapper employeeMapper;

    @GetMapping("list")
    public String list(Model model) {
        model.addAttribute("empList", employeeMapper.getEmpListAndDept());
        return "/Employee/empList";
    }
}
